﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderReturnsDetail.aspx.cs" Inherits="ZLCMS.Web.SystemManage.Basics.Shop.OrderReturns.OrderReturnsDetail" %>

<%@ Import Namespace ="ZLCMS.Business.Util" %>
<%@ Import Namespace="ZLCMS.Commands.User.Util" %>
<div class="pageContent">
    <div class="pageFormContent" layoutH="56">
    
	<div class="panel collapse">
		<h1>售后申请信息：NO.<%= OrderReturnData.Id%></h1>
		<div>
		<table class="list" targetType="navTab" asc="asc" desc="desc" style="width: 100%;">        
        <tr>
            <td>申请售后原因：</td>
            <td>描述详细问题：</td>
			<td>相关图片：</td>
        </tr>
        <tr> 
			<td style="color: red;"><%= ParamKit.GetValue("OrderReturnType", OrderReturnData.ReturnType, "&nbsp;")%></td> 
			<td><%= OrderReturnData.ReturnMemos%></td>
		    <td class="images"><%=GetImageHtml(OrderReturnData.ThumbnailImg)%></td>
        </tr>

        </table>
		</div>
	</div>

<%if (!string.IsNullOrEmpty(OrderReturnData.ProcessRemark))
  {%>
	<div class="panel collapse">
		<h1>售后处理结果：</h1>
		<div style="color: red;"><%= OrderReturnData.ProcessRemark%></div>
	</div>
<%}%>
    
	<div class="panel collapse">
		<h1>售后处理进度：[<%= ParamKit.GetValue("OrderIsConfirmed", OrderReturnData.ConfirmStatus, "&nbsp;")%>][<%= ParamKit.GetValue("ProcessStatus", OrderReturnData.ProcessStatus, "&nbsp;")%>][<%= ParamKit.GetValue("OrderIsFinish", OrderReturnData.FinishStatus, "&nbsp;")%>][<%= ParamKit.GetValue("OrderIsCancel", OrderReturnData.CancelStatus, "&nbsp;")%>]</h1>
		<div>
    	<table class="list" width="100%">
    	<tr>
			<td>
            		<span width="100px;">
                    <%-- 客服确认状态--%>
                    <% if (AuthUtil.CheckAuthorization("ORDER_RETURN_MAN", "CONFIRM"))
                       {%>
                        <%if (OrderReturnData.ConfirmStatus == "1" || OrderReturnData.CancelStatus == "1")
                          {%>
<%--                         [<%= ParamKit.GetValue("OrderIsConfirmed", OrderReturnData.ConfirmStatus, "&nbsp;")%>]--%>
                        <%}
                          else
                          { %>
                         <a style="margin-right: 5px;" class="button" href="/SystemManage/Basics/Shop/OrderReturns/OrderReturnsConfirm.aspx?id=<%= OrderReturnData.Id  %>" target="dialog" rel="orderreturnssendgoods" max="false" mask="true" maxable="false" minable="false" width="800" height="400" title="请确认受理售后申请"><span>受理售后申请</span></a>
                        <%}
                       }%>
                       <%else
                       {%>
<%--                            [<%= ParamKit.GetValue("OrderIsConfirmed", OrderReturnData.ConfirmStatus, "&nbsp;")%>]--%>
                       <%} %>
                </span>
                    <span width="100px;">
                      <%-- 处理状态--%>
                      <%if (AuthUtil.CheckAuthorization("ORDER_RETURN_MAN", "PROCESS"))
                        {%>
                         <%if (OrderReturnData.ProcessStatus == "1" || OrderReturnData.CancelStatus == "1")
                           {%>
<%--                            [<%= ParamKit.GetValue("ProcessStatus", OrderReturnData.ProcessStatus, "&nbsp;")%>]--%>
                         <%}
                           else if (OrderReturnData.ConfirmStatus == "1")
                           { %>
                            <a style="margin-right: 5px;" class="button" href="/SystemManage/Basics/Shop/OrderReturns/OrderReturnsProcessLog.aspx?id=<%= OrderReturnData.Id  %>" target="dialog" rel="OrderReturnsProcessLog" max="false" mask="true" maxable="false" minable="false" width="800" height="400" title="输入处理日志"><span>输入处理日志</span></a>
                            <a style="margin-right: 5px;" class="button" href="/SystemManage/Basics/Shop/OrderReturns/OrderReturnsProcess.aspx?id=<%= OrderReturnData.Id  %>" target="dialog" rel="OrderReturnsProcess" max="false" mask="true" maxable="false" minable="false" width="800" height="400" title="完成售后申请"><span>完成售后申请</span></a>
                          <%}
                           else
                           { %>
<%--                            [<%= ParamKit.GetValue("ProcessStatus", OrderReturnData.ProcessStatus, "&nbsp;")%>]--%>
                         <%}
                        }%>
                        <%else {%>
<%--                        [<%= ParamKit.GetValue("ProcessStatus", OrderReturnData.ProcessStatus, "&nbsp;")%>] --%>
                        <%} %>
                    </span>
                    <span width="100px;">
                    <%-- 完成状态--%>
                    <%if (AuthUtil.CheckAuthorization("ORDER_RETURN_MAN", "FINISH"))
                      { %>
                         <%if (OrderReturnData.FinishStatus == "1" || OrderReturnData.CancelStatus == "1")
                           {%>
 <%--                        [<%= ParamKit.GetValue("OrderIsFinish", OrderReturnData.FinishStatus, "&nbsp;")%>]--%>
                         <%}
                           else if (OrderReturnData.ProcessStatus == "1")
                           { %>
                         <a style="margin-right: 5px;" class="button" href="/SystemManage/Basics/shop/OrderReturns/OrderReturnsFinish.aspx?id=<%= OrderReturnData.Id  %>" target="dialog" rel="orderreturnssendgoods" max="false" mask="true" maxable="false" minable="false" width="800" height="400" title="请确认完成售后申请"><span>完成售后申请</span></a>
                         <%}
                           else
                           { %>
<%--                         [<%= ParamKit.GetValue("OrderIsFinish", OrderReturnData.FinishStatus, "&nbsp;")%>]--%>
                         <%}
                      }%>
                      <%else {%>
<%--                      [<%= ParamKit.GetValue("OrderIsFinish", OrderReturnData.FinishStatus, "&nbsp;")%>]--%>
                      <% } %>
                    </span>
                    <span width="100px;">
                    <%-- 确认取消--%>
                    <% if (AuthUtil.CheckAuthorization("ORDER_RETURN_MAN", "CANCEL"))
                       {%>
                       <%if (OrderReturnData.CancelStatus == "0" && OrderReturnData.ConfirmStatus == "0")
                         {%>
                       <a class="button" href="/SystemManage/Basics/shop/OrderReturns/OrderReturnsCancel.aspx?id=<%= OrderReturnData.Id  %>" target="dialog" rel="orderreturnssendgoods" max="false" mask="true" maxable="false" minable="false" width="800" height="400" title="请确认不受理售后申请"><span>不受理售后申请</span></a>
		            	<%}
                         else
                         { %>
<%--                          [<%= ParamKit.GetValue("OrderIsCancel", OrderReturnData.CancelStatus, "&nbsp;")%>]--%>
		            	<%}
                       }%>
                       <%else {%>
<%--                       [<%= ParamKit.GetValue("OrderIsCancel", OrderReturnData.CancelStatus, "&nbsp;")%>] --%>
                       <%} %>
                    </span>

                    <span width="100px;">
                    <%-- 退款 --%>
                    <%if (AuthUtil.CheckAuthorization("ORDER_RETURN_MAN", "REFUND") && OrderReturnData.CancelStatus == "0" && OrderReturnData.ConfirmStatus == "1" && !string.IsNullOrEmpty(OrderReturnData.ProductSkuNo))
                      { %>
                         <% if (string.IsNullOrEmpty(OrderReturnData.RefundNo)){ %>
                         <a style="margin-right: 5px;" class="button" href="/SystemManage/Basics/shop/OrderReturns/OrderReturnsRefund.aspx?id=<%= OrderReturnData.Id  %>&orderno=<%=OrderReturnData.OrderNo %>&pno=<%=OrderReturnData.ProductNo %>&skuno=<%=OrderReturnData.ProductSkuNo %>"
                          target="dialog" rel="refund" max="false" mask="true" maxable="false" minable="false" width="800" height="400" title="请确认退款操作">
                          <span>申请退款</span>
                          </a>
                         <%}
                           else
                           { %>
                        <a style="margin-right: 5px;" class="button" href="/SystemManage/Basics/Shop/OrderReturns/OrderRefundDetail.aspx?rno=<%=OrderReturnData.RefundNo%>" target="navTab" title="查看退款情况" rel="OrderRefundDetail"><span>查看退款情况</span></a>
                         <%}
                           
                      }%>
                    </span>
            </td>
        </tr>
    	<tr>
			<td>
				
        <table class="list" targetType="navTab" asc="asc" desc="desc" style="width: 100%;">
	    <thead>
			<tr>
				<th width="180px">操作时间</th>
				<th>操作</th>
				<th>内容</th>
			</tr>
		</thead>
		<tbody>
            <asp:repeater runat="server" id="logs">
                <ItemTemplate>
			    <tr target="uid">
                    <td><%# Eval("RecodeDate")%></td>
				    <td><%#  Eval("Title")%></td>
				    <td><%#  Eval("Memos")%></td>
			    </tr>
                </ItemTemplate>
            </asp:repeater>
            <%if (logs.Items.Count == 0)
              { %>
              <tr><td colspan='2'>无记录</td></tr>
            <%} %>
		</tbody>
	</table>
			</td>
	
       </tr>
        </table>
		</div>
	</div>
    
	<div class="panel collapse">
		<h1>售后对象：<%=string.IsNullOrEmpty(OrderReturnData.ProductNo)?"订单":"商品"%></h1>
		<div>
		
    	<table class="list" width="100%">
        <tr>
        <td style="width: 10%;">订单编号：</td>
        <td>
            <a href="/SystemManage/Basics/Shop/Order/OrderDetail.aspx?no=<%=OrderReturnData.OrderNo%>" target="navTab" title="订单详情" rel="OrderDetail"><%=OrderReturnData.OrderNo%></a>&nbsp;&nbsp;
        </td>
		  <td style="width: 10%;">订单状态：</td>
            <td>
                    [<%= ParamKit.GetValue("OrderIsConfirmed", OrderDt.ConfirmedStatus, "&nbsp;")%>]
				    [<%= ParamKit.GetValue("OrderPayStatus", OrderDt.PayStatus, "&nbsp;")%>]
				    [<%= ParamKit.GetValue("OrderShippingStatus", OrderDt.ShippingStatus, "&nbsp;")%>]
				    [<%= ParamKit.GetValue("OrderIsFinish", OrderDt.FinishedStatus, "&nbsp;")%>]
				    [<%= ParamKit.GetValue("OrderIsCancel", OrderDt.CancelStatus, "&nbsp;")%>]
            </td>
        </tr>
        <tr>
         <td style="width: 10%;">收货人姓名：</td>
        <td>
           <%=OrderDt.ReceiverName%>
        </td>
         <td style="width: 10%;">收货人电话：</td>
        <td>
           <%=OrderDt.ReceiverPhone%>
        </td>
        </tr>
         <tr>
         <td style="width: 10%;">收货人地址：</td>
        <td>
           <%=OrderDt.ReceiverAddress%>
        </td>
          <td style="width: 10%;">
          收货人备注：</td>
			<td><%= OrderDt.Remark%></td>
        </tr>
    	<tr>
        <table class="list" targetType="navTab" asc="asc" desc="desc" style="width: 100%;<%=string.IsNullOrEmpty(OrderReturnData.ProductNo)?"display:none":""%>">
	    <thead>
			<tr>
                <th>商品图片</th>
				<th>商品</th>
				<th>规格</th>
				<th>备注</th>
				<th>数量</th>
                <th>商品价格</th>
				<th>单项小计</th>
			</tr>
		</thead>
		<tbody>
			    <tr target="uid">
                 <td style="width:80px;height:80px"><img style="width:80px;height:80px" src="<%=FileKit.FirstFilePath(OrderReturnData.ThumbnailImg) %>"/></td>
				    <td><%= OrderReturnData.ProductSkuNo%><br /><%= OrderReturnData.ProductName %></td>
				     <td><%= OrderProduct!=null ? ZLCMS.Commands.Pub.Util.SkuProductKit.GetSkuItemNames(OrderProduct.SkuData) : ""%></td>
				    <td><%= OrderProduct!=null ? OrderProduct.Remark : "" %></td>
                    <td><%= OrderReturnData.Quantity%></td>
				     <td><%= OrderReturnData.UnitPrice%></td>
				    <td><%= OrderReturnData.TotalPrice%></td>
			    </tr>
            
		</tbody>
	</table>
        </tr>

        </table>
        
        <div class="divider"></div>
      
        
		</div>
	</div>

	</div>
        
	<div class="formBar">
		<ul>
			<li><div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div></li>
		</ul>
	</div>  
</div>

<script type="text/javascript">
    $('td.images').find('.prettyPhoto').prettyPhoto();
</script>
